home *** CD-ROM | disk | FTP | other *** search
/ An Introduction to Progr…l Basic 6.0 (4th Edition) / An Introduction to Programming using Visual Basic 6.0.iso / PROGRAMS / CH10 / 10-1-4.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1998-09-18  |  1.7 KB  |  54 lines

  1. VERSION 5.00
  2. Begin VB.Form frm10_1_4 
  3.    Caption         =   "Square Root"
  4.    ClientHeight    =   2775
  5.    ClientLeft      =   2685
  6.    ClientTop       =   1965
  7.    ClientWidth     =   2745
  8.    BeginProperty Font 
  9.       Name            =   "MS Sans Serif"
  10.       Size            =   8.25
  11.       Charset         =   0
  12.       Weight          =   700
  13.       Underline       =   0   'False
  14.       Italic          =   0   'False
  15.       Strikethrough   =   0   'False
  16.    EndProperty
  17.    LinkTopic       =   "Form1"
  18.    PaletteMode     =   1  'UseZOrder
  19.    ScaleHeight     =   2775
  20.    ScaleWidth      =   2745
  21.    Begin VB.PictureBox picOutput 
  22.       Height          =   1935
  23.       Left            =   120
  24.       ScaleHeight     =   1875
  25.       ScaleWidth      =   2475
  26.       TabIndex        =   1
  27.       Top             =   720
  28.       Width           =   2535
  29.    End
  30.    Begin VB.CommandButton cmdDraw 
  31.       Caption         =   "Draw Graph"
  32.       Height          =   495
  33.       Left            =   600
  34.       TabIndex        =   0
  35.       Top             =   120
  36.       Width           =   1575
  37.    End
  38. Attribute VB_Name = "frm10_1_4"
  39. Attribute VB_GlobalNameSpace = False
  40. Attribute VB_Creatable = False
  41. Attribute VB_PredeclaredId = True
  42. Attribute VB_Exposed = False
  43. Private Sub cmdDraw_Click()
  44.   Dim x As Single
  45.   'Graph the Square Root Function
  46.   picOutput.Cls
  47.   picOutput.Scale (-20, 12)-(120, -2)  'Specify coordinate system
  48.   picOutput.Line (-5, 0)-(100, 0)      'Draw x-axis
  49.   picOutput.Line (0, -1)-(0, 10)       'Draw y-axis
  50.   For x = 0 To 100 Step 0.2            'Plot about 500 points
  51.     picOutput.PSet (x, Sqr(x))         'Plot point on graph
  52.   Next x
  53. End Sub
  54.